// eslint-disable-next-line
import { UserLayout, BasicLayout, BlankLayout, RouteView } from '@/layouts'
import { bxAnaalyse } from '@/core/icons'

export const asyncRouterMap = [
  {
    path: '/',
    name: 'index',
    component: BasicLayout,
    redirect: '/media',
    meta: { title: '首页' },
    children: [
      {
        path: '/media',
        name: 'media',
        component: () => import('@/views/media/media'),
        meta: { title: '上传管理', keepAlive: true, icon: 'file', permission: ['/upload/index'] }
      },
      {
        path: '/authority',
        name: 'authority',
        component: RouteView,
        meta: { title: '权限控制', keepAlive: true, icon: 'safety' },
        children: [
          {
            path: '/authority/user',
            name: 'authorityUser',
            component: () => import('@/views/authority/user/user'),
            meta: { title: '用户管理', keepAlive: true, permission: ['/user/index'] }
          },
          {
            path: '/authority/role',
            name: 'authorityRole',
            component: () => import('@/views/authority/role/role'),
            meta: { title: '角色管理', keepAlive: true, permission: ['/authority/role/index'] }
          },
          {
            path: '/authority/permission',
            name: 'authorityPermission',
            component: () => import('@/views/authority/permission/permission'),
            meta: { title: '权限管理', keepAlive: true, permission: ['/authority/route/app-routes'] }
          },
          {
            path: '/authority/menu',
            name: 'authorityMenu',
            component: () => import('@/views/authority/menu/menu'),
            meta: { title: '菜单管理', keepAlive: true, permission: ['authorityMenu'] }
          }
        ]
      }
    ]
  },
  {
    path: '*',
    redirect: '/404',
    hidden: true
  }
]

/**
 * 基础路由
 * @type { *[] }
 */
export const constantRouterMap = [
  {
    path: '/user',
    component: UserLayout,
    redirect: '/user/passport',
    hidden: true,
    children: [
      {
        path: '/passport',
        name: 'login',
        component: () => import(/* webpackChunkName: "user" */ '@/views/user/Login')
      }
    ]
  },
  {
    path: '/404',
    component: () => import(/* webpackChunkName: "fail" */ '@/views/exception/404')
  }
]
